package com.study.controller;

import com.study.pojo.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * 类名称：UploadController
 * 描述：上传控制器
 *
 * @author: Lixx
 * 创建时间: 2025/03/12
 */

@Slf4j
@RestController
public class UploadController {
    @PostMapping("/upload")
    public Result upload(String name, Integer age, MultipartFile file) {
        log.info("上传文件：{}, {}, {}", name, age, file);
//        if (!file.isEmpty()){
//            try {
//                file.transferTo(new File("D:\\" + file.getOriginalFilename()));
//            } catch (Exception e) {
//                e.printStackTrace();
//            }
//
//        }
        return Result.success();
    }

}
